﻿package com.firewolf.codecounter;

import java.io.File;
import java.util.ArrayList;

public class CountOneProductCodeLineNumber {
	public static void main(String[] args) {
		String dir = "E:\\workSpaceForJavaSE\\Java模式";
		System.out.println("总的代码行数为：  "+countJavaCode(dir));
	}
	
	private static int countJavaCode(String dir){
		int count = 0;
		String srcPath = dir+"/src";
		ArrayList<File> allFiles = FileUtil.getAllFilesWithSuffix(new File(srcPath), ".java");	
		for(File file : allFiles){
			CountOneJavaCodeLineNumber counterUtil = new CountOneJavaCodeLineNumber(file);
			int realCount = counterUtil.getRealCount();
			System.out.println(realCount + "  " + file.getAbsolutePath());
			count += realCount;
		}
		return count;
	}
}
